Change in openvpn[master]: Fix check_session_buf_not_used using wrong index
A message that is not in the archive (sent off-list or not yet received): gerrit.1700694723000.Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d@...2715...
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
to review the following change.
Change subject: Fix check_session_buf_not_used using wrong index
......................................................................
Fix check_session_buf_not_used using wrong index
The inner loop used i instead of j when iterating through the buffers. Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check is not doing anything really useful with i instead of j, it at least is not crashing or anything similar.
---
M src/openvpn/ssl.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/459/1
src/openvpn/ssl.c +1 -1
@@ -3207,7 +3207,7 @@for (int j =0 ; j < ks->send_reliable->size; j++) { -if (ks->send_reliable->array[i].buf.data == dataptr) +if (ks->send_reliable->array[j].buf.data == dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still in" " use (session->key[%d].send_reliable->array[%d])",
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/459?usp=email )
Change subject: Fix check_session_buf_not_used using wrong index
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Tue, 28 Nov 2023 10:43:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH 1/1 Fix check_session_buf_not_used using wrong index
In reply to a message not in the archiveFrom: Arne Schwabe <[email protected]...>
The inner loop used i instead of j when iterating through the buffers. Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check is not doing anything really useful with i instead of j, it at least is not crashing or anything similar.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/459
This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>
src/openvpn/ssl.c +1 -1
@@ -3207,7 +3207,7 @@for (int j =0 ; j < ks->send_reliable->size; j++) { -if (ks->send_reliable->array[i].buf.data == dataptr) +if (ks->send_reliable->array[j].buf.data == dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still in" " use (session->key[%d].send_reliable->array[%d])",
[Openvpn-devel] [PATCH applied] Re: Fix check_session_buf_not_used using wrong index
Indeed, that function seems to be slightly cursed... and this is the right fix. For this bug.
Tested more thoroughly :-) (full server test runs + GHA).
Your patch has been applied to the master and release/2.6 branch.
commit 59551b93cdb55397d63b2fe58ad99612821c0faf (master) commit 5def8d935335619b16452b56b332d06f4d621d75 (release/2.6)
Author: Arne Schwabe Date: Tue Nov 28 11:43:59 2023 +0100
Fix check_session_buf_not_used using wrong index
Signed-off-by: Arne Schwabe <[email protected]...>
Acked-by: Frank Lichtenheld <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27576.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/459?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld
Change subject: Fix check_session_buf_not_used using wrong index
......................................................................
Fix check_session_buf_not_used using wrong index
The inner loop used i instead of j when iterating through the buffers.
Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check was not doing anything really useful with i instead of j, at least it was not crashing or anything similar.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27576.html
---
M src/openvpn/ssl.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/459/2
src/openvpn/ssl.c +1 -1
@@ -3207,7 +3207,7 @@for (int j =0 ; j < ks->send_reliable->size; j++) { -if (ks->send_reliable->array[i].buf.data == dataptr) +if (ks->send_reliable->array[j].buf.data == dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still in" " use (session->key[%d].send_reliable->array[%d])",
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/459?usp=email )
Change subject: Fix check_session_buf_not_used using wrong index
......................................................................
Fix check_session_buf_not_used using wrong index
The inner loop used i instead of j when iterating through the buffers.
Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check was not doing anything really useful with i instead of j, at least it was not crashing or anything similar.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27576.html
---
M src/openvpn/ssl.c
1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl.c +1 -1
@@ -3207,7 +3207,7 @@for (int j =0 ; j < ks->send_reliable->size; j++) { -if (ks->send_reliable->array[i].buf.data == dataptr) +if (ks->send_reliable->array[j].buf.data == dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still in" " use (session->key[%d].send_reliable->array[%d])",
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged